package com.zjut.azhen.DBDesign.service;

import com.zjut.azhen.DBDesign.bean.Course;
import com.zjut.azhen.DBDesign.bean.Report;
import com.zjut.azhen.DBDesign.mapping.CourseMapper;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
public class CourseService {
    CourseMapper courseMapper;
    CourseService(CourseMapper courseMapper){
        this.courseMapper=courseMapper;
    }
    public List<String> getTerms(){
        return courseMapper.getTerms();
    }
    public List<Course> getCourses(String sno,String term){
        return courseMapper.queryCourseBySno(sno,term);
    }

    public List<Course> getTeach(String tno,String term){
        return courseMapper.queryCourseTeach(tno,term);
    }

    public List<Course> getClassC(String clno, String term,String sno) {
        return courseMapper.queryCourseByClno(clno,term,sno);
    }


    public List<Report> getAVG(String term) {
        return courseMapper.getAVG(term);
    }

    public Integer insertSC(String sno, String cno) {
        return courseMapper.inserSC(sno,cno);
    }

    public Integer deleteSCById(String sno, String cno) {
        return courseMapper.deleteSCById(sno,cno);
    }

    public List<Course> getByClassName(String classname, String term) {
        return courseMapper.getByClassName(classname,term);
    }


}
